package com.apes.enquiry.brand.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.apes.framework.jpa.ApesBean;
import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.util.DateUtil;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 类描述：品质
 *
 * @ClassName qualityN
 * @Description 描述
 * @Author wushilong
 * @Date 2022/11/3 14:12
 * @Version 1.0
 */

@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = Quality.CONST_TABLE_NAME)
public class Quality implements ApesBean {

    public static final String CONST_TABLE_NAME = "mas_pzxx";

    @Id
    @Column(name = "PZID", length = 8)
    @Comment("品质编码")
    private String id;

    @NotNull
    @Column(name = "PZMC")
    @Comment("品质名称")
    private String name;

    @Column(name = "TS01", length = 36)
    private String TS01;

    @Column(name = "LRR", length = 64)
    private String LRR;

    @JSONField(format = DateUtil.SHOW_DATE_FORMAT)
    @Temporal(TemporalType.DATE)
    private Date LRRQ_SJ;

    @Column(name = "PZDY", length = 2000)
    @Comment("描述")
    private String description;
}
